import { defineStore } from 'pinia'
import { getTokenApi } from '@/apis/mock'

export const useUserTokenStore = defineStore(
  'user',
  () => {
    const token = ref('')

    const getUserToken = async (params) => {
      const result = await getTokenApi(params)
      token.value = result.data.token
    }
    return {
      token,
      getUserToken,
    }
  },
  {
    persist: true,
  },
)
